package org.lc.service.system.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.lc.platform.base.result.Result;
import org.lc.platform.mybatis.crud.controller.CrudBaseController;
import org.lc.service.system.dto.SysDepartmentDto;
import org.lc.service.system.entity.SysDepartment;
import org.lc.service.system.service.SysDepartmentService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Validated
@RestController
@RequestMapping("/department")
@Tag(name = "部门模块")
public class SysDepartmentController extends CrudBaseController<SysDepartment, SysDepartment, SysDepartmentDto, SysDepartmentService> {
    public SysDepartmentController(SysDepartmentService service) {
        super(service);
    }


    @Operation(summary = "获取组织树")
    @GetMapping("/tree/list")
    private Result<List<SysDepartment>> getDepartmentTreeList() {
        return Result.data(this.getService().getDepartmentTreeList());
    }

}